package com.yyge.kt.base

import android.annotation.SuppressLint
import android.view.View
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import com.yyge.base.BaseActivity

class BaseWebView(webView:WebView) {
     //初始化
     init {
         this.initWebView(webView)
     }

     @SuppressLint("SetJavaScriptEnabled")
     fun initWebView(webView:WebView){
        webView.settings.javaScriptEnabled=true
        webView.webViewClient = webViewClient()
        webView.webChromeClient = webChromeClient()
        webView.loadUrl("https://bk.yyge.net/")
    }

     class webViewClient: WebViewClient(){
        //页面加载完毕时调用
        override fun onPageFinished(view: WebView?, url: String?) {
            super.onPageFinished(view, url)
        }
    }


     class webChromeClient: WebChromeClient(){
        override fun onProgressChanged(view: WebView?, newProgress: Int) {
            super.onProgressChanged(view, newProgress)
        }
    }

}